<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="/index/css/style.css">
	<link rel="stylesheet" href="/index/css/org.css">
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <link rel="stylesheet" href="/index/css/bootstrap.min.css" type="text/css">
    <script src="/index/js/bootstrap.min.js"></script> 
	<title>个人中心</title>
	<link rel="stylesheet" type="text/css" href="/index/css/userinfo-base.css">
	<link rel="stylesheet" type="text/css" href="/index/js/address/address.css">
	<script src="/index/js/jQuery-1.11.3.min.js"></script>
	<script src="/index/js/address/Popt.js"></script>
	<script src="/index/js/address/cityJson.js"></script>
	<script src="/index/js/address/citySet.js"></script>
</head>
<body>
	<div class="container-fluid">
  		<div class="row nav1">
		 	<div class="col-md-12 nav1">
		 		<div class="col-md-3 nav">
					<div class="col-md-6"></div>
					<div class="col-md-6">常用设置</div>
		 		</div>
		 		<div class="col-md-6 nav">
		 			<div class="col-md-3"><a href="/">返回首页</a></div>
		 			<div class="col-md-3">小米系列</div>
		 			<div class="col-md-3">oppo系列</div>
		 			<div class="col-md-3">华为系列</div>
		 		</div>
		 		<div class="col-md-3 nav">
		 			<div class="col-md-6">更多商品</div>
		 		</div>
		 	</div>
		</div>
		<div class="row">
			<div class="col-md-5 col-md-offset-1" id="myx">
				<ul>
					<li>
						<a href="http://www.ecmall.com/" style="text-decoration: none">首页&nbsp;>&nbsp;</a>蚂蚁线
					</li>
				</ul>
			</div>
		</div>
		<div class="row">
			<div class="col-md-3" >
				<div class="col-md-7 col-md-offset-5" id="nav-left">
					<ul class="menu">
						<li></li>
						<li></li>
					</ul>
					<ul class="menu">
						<li class="li-title">订单中心</li>
						<li>&nbsp;&nbsp;<a href="">我的订单</a></li>
						<li>&nbsp;&nbsp;<a href="">我的评价</a></li>
					</ul>
					<ul class="menu">
						<li class="li-title">我的关注</li>
						<li>&nbsp;&nbsp;<a href="">关注商品</a></li>
						<li>&nbsp;&nbsp;<a href="">浏览历史</a></li>
					</ul>
					<ul class="menu">
						<li class="li-title">我的资产</li>
						<li>&nbsp;&nbsp;<a href="">积分信息</a></li>
						<li>&nbsp;&nbsp;<a href="">账户余额</a></li>
					</ul>
					<ul class="menu">
						<li class="li-title">个人设置</li>
						<li id="adds">&nbsp;&nbsp;<a href="address">收货地址</a></li>
						<li>&nbsp;&nbsp;<a href="info">个人信息</a></li>
					</ul>
					<ul class="menu">
						<li class="li-title">安全中心</li>
						<li>&nbsp;&nbsp;<a href="">修改密码</a></li>
						<li>&nbsp;&nbsp;<a href="">收货地址</a></li>
						<li>&nbsp;&nbsp;<a href="">帮助中心</a></li>
					</ul>
				</div>
		 	</div>
			<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
				<div class="modal-dialog modal-lg" role="document">
			    	<div class="modal-content" style="padding:100px">
			      		<div class="row">
			      			<div class="col-md-10" style="font-size: 40px;height: 40px;line-height: 40px;">添加收货地址</div>
			      		</div>
			      		<div class="row" style="margin-top: 20px">
			      			<div class="col-md-6">
			      				<input class="input" type="text" name="name" placeholder="请输入收货人姓名">
			      			</div>
			      			<div class="col-md-6">
			      				<input class="input" type="text" name="phone" placeholder="请输入收货人联系方式">
			      			</div>
			      		</div>
			      		<div class="row" style="margin-top: 20px">
			      			<div class="col-md-12">
			      				<input type="text" id="city" class="input" name="city" placeholder="请选择省/市/县"/>
			      			</div>
			      		</div>
			      		<div class="row" style="margin-top: 20px">
			      			<div class="col-md-12">
			      				<input class="input" type="text" name="address" placeholder="请输入详细地址" style="width: 700px;">
			      			</div>
			      		</div>
			      		<div class="modal-footer">
					    	<button type="button" id="save" class="btn btn-default" data-dismiss="modal">保存</button>
					    	<button type="button" class="btn btn-primary" data-dismiss="modal">取消</button>
						</div>
			    	</div>
			  	</div>
			</div>
		 	<div class="col-md-8">
		 		<div class="row content">
		 			<div class="row" style="padding: 40px;">
		 				<div class="col-md-10">
		 					<button class="btn btn-primary" data-toggle="modal" data-toggle="modal" data-target=".bs-example-modal-lg">新增收货地址</button>&nbsp;&nbsp;&nbsp;&nbsp;您已经创建了{$count}个收货地址，最多可创建5个
		 				</div>
		 				{volist name="data" id="result"}
<!-- 		 				<input type="hidden" id="getid" value="{$result.id}">
		 				<div class="getid" style="display: none">{$result.id}</div> -->
		 				<div class="col-md-12" style="height: 75px;">
		 					<div class="row" style="margin-top: 15px">
		 						<div class="col-md-1" style="line-height:75px;">
		 							<img src="/images/userinfo/portal-icon-2.png">
		 						</div>
		 						<div class="col-md-3" style="margin-left: -60px;font-size:16px;text-align: right;">
				 					<span>姓名：</span><br />
				 					<span>地区：</span><br />
				 					<span>地址：</span><br />
				 					<span>手机：</span><br />
		 						</div>
		 						<div class="col-md-8" style="margin-left: -10px;font-size:16px;">
				 					<span>{$result.name}</span><br />
				 					<span>{$result.city}</span><br />
				 					<span>{$result.address}</span><br />
				 					<span>{$result.phone}</span><br />
		 						</div>
		 					</div>
		 				</div>
		 				<div class="col-md-12" style="border-bottom:1px dotted gray;text-align: right;font-size: 16px">
		 				{if $result.ismain == 1}
		 					<b style="color: red">默认地址&nbsp;</b>
		 				{else}
		 					<a href="addressSet?id={$result.id}"><button class="btn btn-primary">设为默认地址</button></a>
		 				{/if}
		 					<a href="addressDel?id={$result.id}" id="del"><button class="btn btn-primary">删除</button></a>
		 					<!-- <a href=""><b id="update">&nbsp;修改</b></a> -->
		 					<button class="btn btn-primary" data-toggle="modal" data-toggle="modal" data-target=".{$result.id}" class="update">修改</button>
		 				</div>
						<div class="modal fade {$result.id}" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
							<div class="modal-dialog modal-lg" role="document">
						    	<div class="modal-content" style="padding:100px">
						    	<form action="addressUpdate" method="post">
						      		<div class="row">
						      			<div id="getid">{$result.id}</div>
						      			<div class="col-md-10" style="font-size: 40px;height: 40px;line-height: 40px;">修改收货地址</div>
						      		</div>
						      		<div class="row" style="margin-top: 20px">
						      			<div class="col-md-6">
						      				<input class="input" type="text" name="name1" placeholder="请输入收货人姓名" value= {$result.name}>
						      			</div>
						      			<div class="col-md-6">
						      				<input class="input" type="text" name="phone1" placeholder="请输入收货人联系方式" value= {$result.phone}>
						      			</div>
						      		</div>
						      		<div class="row" style="margin-top: 20px">
						      			<div class="col-md-12">
						      				<input type="text" id="city2" class="input" name="city1" placeholder="请选择省/市/县" value= {$result.city} />
						      			</div>
						      		</div>
						      		<div class="row" style="margin-top: 20px">
						      			<div class="col-md-12">
						      				<input class="input" type="text" name="address1" placeholder="请输入详细地址" style="width: 700px;" value= {$result.address}>
						      			</div>
						      		</div>
						      		<div class="modal-footer">
								    	<button type="submit" id="saveupdate" class="btn btn-default" data-dismiss="modal" name="save">保存</button>
								    	<button type="button" class="btn btn-primary" data-dismiss="modal">取消</button>
									</div>
						    	</div>
						  	</div>
						  	</form>
						</div>
						{/volist}
		 			</div>	
		 		</div>
			</div>
		</div>
	</div>
</body>
<!-- 地址选择菜单 -->
<script type="text/javascript">
$(function(){
	$("#city").click(function (e) {
		SelCity(this,e);
	});
})
$(function(){
	$("#city2").click(function (e) {
		SelCity(this,e);
	});
})
$(function(){
	$(".update").click(function(){
		var aaa = $("#getid").val()
		alert(aaa);
	});
});
</script>
<!-- AJAX传递地址信息 -->
<script type="text/javascript">
// 用户名检测
$(function(){
	$("#save").click(function(){
		var city = $("input[name='city']").val();
		// alert(city);
		var name = $("input[name='name']").val();
		var phone = $("input[name='phone']").val();
		var address = $("input[name='address']").val();
		$.post("addressCheck",{'city':city,'name':name,'phone':phone,'address':address},function(data){
			alert(data);
			location.reload();	
		});
	})
	// $("#saveupdate").click(function(){
	// 	var uid = $("input[name='getid']").val();
	// 	alert(uid);
	// 	var name = $("input[name='name1']").val();
	// 	var phone = $("input[name='phone1']").val();
	// 	var city = $("input[name='city1']").val();
	// 	var address = $("input[name='address1']").val();
	// 	// alert(123);
	// 	$.post("addressUpdate",{'id':id,'city':city,'name':name,'phone':phone,'address':address},function(data){
	// 		alert(data);
	// 		location.reload();	
	// 	});
	// })
});
</script>
</html>

